from django.conf.urls import url

from rest_framework import routers
from . import views

router = routers.DefaultRouter()
router.register(r'books',views.BookViewSet),
# router.register(r'movies',views.MovieViewSet),


urlpatterns = [
    url(r'^games/',views.GameCreatAPIView.as_view()),
    url(r'^movies/$',views.MovieViewSet.as_view(
        actions={
            "get":"list",
            "post":"create",
        }
    )),#这个主要用来查看或者增加指定的内容
    url(r'^movies/(?P<pk>\d+)/',views.MovieViewSet.as_view(
        actions={
            "get":"retrieve", #这些可以在django_restframework 下的 mixins.py下面查看
            "put":"update",
            "patch":"update",
            "delete":"destroy"
        }
    )),#这个主要用来查看某一个的详情
    url(r'^users/',views.UserCreateApiView.as_view()),
]



